package com.danco.training.hoteladmin.storage;

import java.util.Comparator;
import com.danco.training.hoteladmin.core.Room;

public class RoomSortByStars implements Comparator<Room>{
	@Override
	public int compare(Room o1, Room o2) {
		if(o1.getCountOfStars() > o2.getCountOfStars()) { 
            return 1;
		}
		else if(o1.getCountOfStars() < o2.getCountOfStars()) { 
            return -1;
		}
		else { 
            return 0;
		}
	} 
}